import request from "@/utils/request";
import type {OrderCreateParamsType, OrderIndexParamsType} from "@/types/order";
export default {
    /*订单相关*/
    //计算订单
    calcApi: (order_type:string) => request({
        url: '/api/sumdc.order.order/calc',
        method: 'POST',
        data: {
            order_type:order_type
        },
        custom: {
            auth: true,
        }
    }),
    //提交订单
    createApi: (data:OrderCreateParamsType) => request({
        url: '/api/sumdc.order.order/create',
        method: 'POST',
        data: data,
        custom: {
            auth: true,
        }
    }),
    //订单列表
    indexApi: (params:OrderIndexParamsType) => request({
        url: '/api/sumdc.order.order/index',
        method: 'GET',
        params,
        custom: {
            auth: true,
        }
    }),
    //订单详情
    detailApi: (id:number) => request({
        url: '/api/sumdc.order.order/detail',
        method: 'GET',
        params:{id:id},
    }),

}
